import java.util.Scanner;

public class HomeWork12_03{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int[] arr = new int[]{1, 2, 3, 4, 5};
        
        System.out.print("输入需要删除的元素的索引(0~4)：");
        int index = scan.nextInt();
        
        arr = ArrOprt.IntArrDelete(arr, index);
        
        for(int item : arr){
            System.out.println(item);
        }
    }
}

class ArrOprt{
    public static int[] IntArrDelete(int[] arr, int index){
        int[] newArr = new int[arr.length - 1];
        int j = 0;
        for(int i = 0; i < arr.length; i++){
            if(index != i){
                newArr[j++] = arr[i];
            }
        }
        
        return newArr;
    }
}